package cn.livingCloud.service.impl.operation;

import cn.livingCloud.context.BeanProvider;
import cn.livingCloud.dto.ArticleReplyDto;
import cn.livingCloud.entity.content.ArticleReply;
import cn.livingCloud.entity.content.ImageTextReply;
import cn.livingCloud.repository.ArticleReplyMapper;

/**
 * Created by 唐旭 on 2015/12/26.
 */
public class ArticleReplyUpdater {
    private transient ArticleReplyMapper articleReplyMapper = BeanProvider.getBean(ArticleReplyMapper.class);

    public void update(ArticleReplyDto articleReplyDto, ImageTextReply imageTextReply, int rank) {
        ArticleReply reply = new ArticleReply(imageTextReply, rank);
        articleReplyDto.update(reply);
        articleReplyMapper.save(reply);
    }
}
